<ion-header>

  <ion-navbar>

    <ion-buttons left>
      <button ion-button icon-only (click)="onSubmit()">
        <ion-icon name="ios-arrow-back"></ion-icon>
        <!--<span ion-text class="ml5">返回</span>-->
      </button>
    </ion-buttons>
    <ion-input class="bgcolor_white font_black_111 mt0 mb0" style="height: 25px; border-radius: 20px;"
               placeholder="请输入物料名称查找"
               [(ngModel)]="query_field" (keydown)="shuRus($event)" (blur)="sJq()">
    </ion-input>
    <ion-buttons right>
      <button ion-button icon-only (click)="query()">
        <i class="fa fa-search"></i>
      </button>
    </ion-buttons>
  </ion-navbar>

</ion-header>


<ion-content>
  <div class="w12 bgcolor_white" style="height: 100%;">
    <div class="content w12 plr10" style="padding-bottom:60px !important;">
      <div class="w12 lh25 font_size_standard">
        <div class="w12 pt5 pb10 border_bottom" *ngFor="let pro of queryPros">
          <div class="w12 cart_pro_item pl0 pr0 mb0">
            <div class="cart_pro_info pl10">
              <img class="hide" src="">
              <h3 class="w12 pro_name">{{pro.PRODUCT_NAME}}——{{pro.JQJX_NAME}}</h3>
              <span class="w04 font_gray font_size_msmall">库存：{{pro.PJSL}}</span>
              <span class="w04 font_gray font_size_msmall">单位:{{pro.AMOUNT_UOM_ID}}</span>
              <div class="w12 mt5">
                <div class="w06 pro_pic">
                  <span class="fl">￥</span>
                  <b class="fl">{{pro.PRICE | money}}</b>
                  <i class="ml10 fa fa-pencil font_black_000" (click)="setPrice(pro)"></i>
                </div>
                <div class="num_p_m mt5">
                  <button class="p" ion-button (click)="currentQuantityChange(pro,0)">-</button>
                  <input type="number" [value]="pro.QUANTITY" [(ngModel)]="pro.QUANTITY" (keydown)="kdqc($event,pro)"
                         (blur)="eqc(pro)" readonly>
                  <button ion-button (click)="currentQuantityChange(pro,1)">+</button>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

    </div>
  </div>
  <div class="tccbg" *ngIf="isClick" (click)="isClick = false">
    <div class="tccbox animated fadeInUp" (click)="$event.stopPropagation()">
      <div class="w12 lh35 plr10 border_bottom bgcolor_gray_444 font_black_666 font_size_standard">
        所选辅材
        <span class="fr" (click)="clearAll()"><i class="fa fa-trash-o pr5 font_size_large"></i>清空</span>
      </div>
      <div class="w12 lh20 plr10 tccontent ">
        <ng-container *ngFor="let pros of getPros">
          <ng-container *ngFor="let pro of pros">
            <div class="w12 pt10 pb10 font_size_large border_bottom" *ngIf="pro.QUANTITY>0">
              <span class="w05">{{pro.PRODUCT_NAME}}</span>
              <span class="w03 font_red font_size_large">￥{{pro.PRICE}}</span>
              <div class="num_p_m fr">
                <button class="p fl" *ngIf="pro.QUANTITY>0" (click)="quantityChange(pro,0)">
                  <span>-</span>
                </button>
                <input class="fl" type="number" style="width: 45px" [value]="pro.QUANTITY" disabled>
                <button class="fl button button-md button-default button-default-md"
                        (click)="quantityChange(pro,1)">
                  <span>+</span>
                </button>
              </div>
            </div>
          </ng-container>
        </ng-container>

      </div>
    </div>
  </div>
  <div class="bottom-box">
    <div class="w09 left font_size_standard" (click)="num>0?isClick = !isClick:''">
            <span class="bgcolor_white tc fl more">
                <i class="fa fa-cart-plus font_blue lh40 pt5"></i>
                <em>{{this.num}}</em>
            </span>
      <span class="fl lh40 pl10">合计：</span><span class="fl font_size_super font_weight_bold lh40">￥{{sum}}</span>
    </div>
    <div class="w03 fr" (click)="onSubmit()"><span class="w12 bgcolor_blue font_white tc btn">确定</span></div>
  </div>
</ion-content>
